﻿@model WidgetHelper
<div>
    @Html.Global("publishing", "SelectCategory")</div>
@(
 Ajax.Dna().TreeView(Model.GenerateFieldID("TreeView"))
         .HtmlAttributes(new { style = "height:200px;border:1px solid #cccccc;overflow:auto;padding-top:10px;" })
         .Options(opts =>
         {
             opts.OnNodeSelected = "$(\"#" + Model.GenerateFieldID("CategoryID") + "\").val($(node).attr(\"key\"));";
             opts.SinglePathExpand = true;
         })
         .ExpandedLevel(1)
                 .SelectNode("key", Model.UserPreferences["CategoryID"].ToString())
         .Bind(((HierarchicalNodeProviderBase)ViewBag.Provider).RootNode, node =>
         {
             node.NavigateUrl = "javascript:void(0);";
             node.ImageUrl = Url.Content("~/content/images/icon_cat_16.gif");
             return true;
         }, true)
         .GetHtml())
<input type="hidden" value="@Model.GetInt("CategoryID")" id="@Model.GenerateFieldID("CategoryID")" name="@Model.GenerateFieldID("CategoryID")" />
<div>
    @(
 Ajax.Dna().ListBox(Model.GenerateFieldID("Layout"))
 .Options(opts =>
 {
     opts.IsInlineMode = true;
 })
 .HtmlAttributes(new { style = "width:auto;height:150px; border:none;" })
         .Select(Model.GetString("Layout"))
 .ItemHtmlAttributes(new { style = "float:left;width:120px;padding-top:3px;padding-right:3px;margin-right:2px;" })
    .Items(items =>
    {
        items.Add(new NavigableData()
        {
            ToolTip = "Title",
            Value = "_TitleLayout",
            ImageUrl = Url.Content("~/content/images/img_title_layout.jpg")
        });
        items.Add(new NavigableData()
        {
            ToolTip = "Summary",
            Value = "_SummaryLayout",
            ImageUrl = Url.Content("~/content/images/img_summary_layout.jpg")
        });
        items.Add(new NavigableData()
        {
            ToolTip = "Detail",
            Value = "_DetailLayout",
            ImageUrl = Url.Content("~/content/images/img_detail_layout.jpg")
        });
        items.Add(new NavigableData()
        {
            ToolTip = "Accordion",
            Value = "_AccordionLayout",
            ImageUrl = Url.Content("~/content/images/img_accordion_layout.jpg")
        });
    })
    .GetHtml()
    )
</div>
<div>
    <div>
        @Html.Global("publishing", "DisplayRows")</div>
    <div>
        @Ajax.Dna().Number(Model.GenerateFieldID("Rows"), Model.GetInt("Rows")).GetHtml()
    </div>
</div>
<div>
    <div>
        @Html.Global("publishing", "DisplayTextLen")</div>
    <div>
        @Ajax.Dna().Number(Model.GenerateFieldID("TextLen"), Model.GetInt("TextLen")).GetHtml()
    </div>
    <div>
        (@Html.Global("publishing", "DisplayTextLenTip"))</div>
</div>
<div style="overflow: hidden;">
    @Ajax.Dna().Checkbox(Model.GenerateFieldID("ShowAuthor"), "Show post user", (bool)Model.UserPreferences["ShowAuthor"]).GetHtml()
</div>
<div style="clear: left; overflow: hidden;">
    @Ajax.Dna().Checkbox(Model.GenerateFieldID("ShowDate"), "Show post date", (bool)Model.UserPreferences["ShowDate"]).GetHtml()
    <span style="clear: left;"></span>
</div>
